package com.sztz.mapstruct.L枚举转换;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ValueMapping;
import org.mapstruct.factory.Mappers;

/**
 * CarMapper
 *
 * @author yyf
 * @email yeyafei@hotmail.com
 */
@Mapper
public interface CarMapper {

    CarMapper INSTANCE = Mappers.getMapper(CarMapper.class);

    /**
     * 枚举转换
     *
     * @param car
     * @return CarDto
     */
    @Mapping(source = "enum1", target = "enum2")
    @ValueMapping(source = "ENUM1_TEST", target = "ENUM2_TEST")
    CarDTO toDto(Car car);
}
